package edu.rutgers.rucampusinfo.directory;

import java.util.List;

import javax.jdo.PersistenceManager;
import javax.jdo.Query;

import edu.rutgers.rucampusinfo.PMF;
import edu.rutgers.rucampusinfo.tables.Role;

public class EmpDirTools {

	public static String getRoleFromID(String roleid){
		String rolestr = null;
		PersistenceManager pm = PMF.get().getPersistenceManager();
		Query query = pm.newQuery("SELECT FROM "+Role.class.getName()+" where roleid = \""+roleid+"\"");
		List<Role> results = (List<Role>)query.execute();
		if(results.iterator().hasNext())
		{
			for(Role role : results){
				rolestr = role.getRoleid();
			}
		}
		return null;
	}
}
